<%@ page import="custom.*,java.util.*" %>

<html>
<head>

<title>Country of residence</title>
</head>
<body>
	<%
		String firstName = (String)session.getAttribute("firstName");
		String middleName = (String)session.getAttribute("middleName");
		String lastName = (String)session.getAttribute("lastName");
		int ccid = Integer.parseInt(request.getParameter("ccid")); // country of citizenship id
		session.setAttribute("ccid", ccid);

		Vector countries = support.getCountries();
	%>
    First Name: <%= firstName %>
    <br>
    Middle Initial: <%= middleName %>
    <br>
    Last Name: <%= lastName %>
    <br>
    Country of citizenship: <%= countries.get(ccid) %>
    <br><br>
    Please select your country of residence:
    <br>
    <a href="address.jsp?crid=<%= ccid %>">Same with country of citizenship</a>
    <br><br>
    <table>
    <%
    for(int i=1;i<countries.size(); i++) {
    	if(i%3==1) {
    		if(i!=1) {
    			%></tr><%
    		}
    		%><tr><%
    	}
    	%><td><a href="address.jsp?crid=<%= i %>"><%= countries.get(i) %></a></td>
    <%}
	%>
	</tr>
	</table>
</body>
</html>
